package com.zed.games.repository;

import com.zed.api.common.ObjectRegistration;
import com.zed.api.games.Game;
import com.zed.api.domain.currentuser.Account;
import com.zed.api.games.ImmutableGameWrapper;

/**
 * 账户游戏对象
 *
 * @author Zed
 */
public class AccountGameObjectRegistration implements ObjectRegistration<AccountGame> {

    private AccountGame accountGame;

    public AccountGameObjectRegistration(Account account, ImmutableGameWrapper game) {
        this.accountGame = new AccountGame(account, game);
    }

    @Override
    public AccountGame getRegistObject() {
        return this.accountGame;
    }

    @Override
    public boolean unregister() {
        if (this.accountGame != null) {
            this.accountGame = null;
            return true;
        }
        return false;
    }
}
